package com.financing.wap.dto;

import java.math.BigDecimal;
import java.util.Date;

import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.format.annotation.DateTimeFormat;

import com.financing.wap.util.Constants;
import com.financing.wap.util.SecureUtil;

/**
 * @author lisu
 * 	wap_jee_1.3 
 * 		annualRevenue 预期收益Double 改成文本框 String 
 * 	 	author lisu
 */
public class OrderDTO extends BaseToDTO {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6295449416070491306L;
	/**
	 * faid
	 */
	private String faid;
	/**
	 * 产品id
	 */
	@NotEmpty(message = "pid is can't null")
	private Integer pid;
	/**
	 * 客户id
	 */
	private Integer clientid;
	/**
	 * 购买金额
	 */
	@NotEmpty(message = "amount is can't null")
	private BigDecimal amount;
	/**
	 * 预期年化收益
	 */
	private String annualRevenue;
	/**
	 * 返佣率
	 */
	private BigDecimal rebateRate;
	/**
	 * 返佣额
	 */
	private BigDecimal rebateAmount;
	/**
	 * 销售价
	 */
	private BigDecimal sellingPrice;
	/**
	 * 销售返佣额
	 */
	private BigDecimal sellingRebate;
	/**
	 * 成本价
	 */
	private BigDecimal costPrice;
	/**
	 * 成本返佣额
	 */
	private BigDecimal costRebate;
	/**
	 * 核心价
	 */
	private BigDecimal corePrice;
	/**
	 * 核心返佣额
	 */
	private BigDecimal coreRebate;
	/**
	 * 成交价
	 */
	private BigDecimal transactionPrice;
	/**
	 * 成交返佣额
	 */
	private BigDecimal transactionRebate;
	/**
	 * 备注
	 */
	private String remark;
	@DateTimeFormat(pattern="yyyy-MM-dd")
    private Date createDate;
    private String createBy;
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date updateDate;
    private String updateBy;
	/**
	 * 销售状态
	 */
	private Integer payStatus;
	/**
	 * 产品名称
	 */
	private String pName;
	/**
	 * 产品状态
	 */
	private String oStatus;
	
	private String noStatus;
	
	/**
	 * 店铺ID
	 */
	private String shopperId;
	
	
	/**
	 * 产品类型
	 */
	private String pType;
	/**
	 * 产品代码
	 */
	private String pCode;
	/**
	 * 产品总金额（发型规模）
	 */
	private BigDecimal pIssuingScale;
	/**
	 * 客户姓名
	 */
	private String cName;
	
	/**
	 * 客户电话
	 */
	private String cMobile;
	
	
	/**
	 * 订单编码
	 */
	private String orderCode;
	
	private String faName;
	
	/**
	 * 机构Fa 部门 id
	 */
	private Integer faCorpId;
	
	/**
	 * 机构FA 机构名称
	 */
	private String faCorpName;
	
	/**
	 * fa姓名
	 */
	private String faRealName;
	
	/**
	 * fa邮箱
	 */
	private String faEmail;
	
	/**
	 * fa图片地址
	 */
	private String uImage;
	
	/**
	 * 资料上传后审核状态
	 * 
	 */
	private String dataStatus;
	
	/**
	 *
	 */
	private Boolean flagUpload;
	
	/**
	 *是否为协议价
	 */
	private String isAgreement;
	
	
	/**
	 * 加密用户id
	 */
	private String uuId;
	
	// ————订单流程改造 后端相关
	/**
	 * 返佣率
	 */
	private BigDecimal backRebateRate;
	/**
	 * 返佣额
	 */
	private BigDecimal backRebateAmount;
	/**
	 * 销售价
	 */
	private BigDecimal backSellingPrice;
	/**
	 * 销售返佣额
	 */
	private BigDecimal backSellingRebate;
	/**
	 * 成本价
	 */
	private BigDecimal backCostPrice;
	/**
	 * 成本返佣额
	 */
	private BigDecimal backCostRebate;
	/**
	 * 核心价
	 */
	private BigDecimal backCorePrice;
	/**
	 * 核心返佣额
	 */
	private BigDecimal backCoreRebate;
	/**
	 * 成交价
	 */
	private BigDecimal backTransactionPrice;
	/**
	 * 成交返佣额
	 */
	private BigDecimal backTransactionRebate;
	
	private String oMediaSource;
	
	// ————订单流程改造 后端相关
	// 有单相关
	/**
	 * 订单承销人ID
	 */
	private String oOwnerId;
	/**
	 * 有单竞价返佣额
	 */
	private BigDecimal oYouDanRebate;
	/**
	 * 有单价
	 */
	private BigDecimal oYouDanPrice;
	/**
	 * 收益率ID
	 */
	private Integer annualRrevenueId;
	/**
	 * 有单收益率ID
	 */
	private Integer biddingReceiptId;
	/**
	 * 后端状态
	 */
	private Integer oBackStatus;
	
	/**
	 * 有单_收到竞价佣金
	 */
	private BigDecimal oYouDanReceivedRebate;

	private BigDecimal commission;//佣金

	private String  createDateStr;//格式化日期

//	private String timeStr;//金策师机构版 - 全部订单时间集合字符串
	private String isAll;//金策师机构版 - 标识是否查询全部订单  是:true
	private String allOrderStatus;//金策师机构版 - 查询全部成交订单的状态集合
	
	public String getIsAgreement() {
		return isAgreement;
	}
	public void setIsAgreement(String isAgreement) {
		this.isAgreement = isAgreement;
	}
	public String getDataStatus() {
		return dataStatus;
	}
	public void setDataStatus(String dataStatus) {
		this.dataStatus = dataStatus;
	}
	public String getFaName() {
		return faName;
	}
	public void setFaName(String faName) {
		this.faName = faName;
	}
	public String getOrderCode() {
		return orderCode;
	}
	public void setOrderCode(String orderCode) {
		this.orderCode = orderCode;
	}
	public String getcName() {
		return cName;
	}
	public void setcName(String cName) {
		this.cName = cName;
	}
	public BigDecimal getpIssuingScale() {
		return pIssuingScale;
	}
	public void setpIssuingScale(BigDecimal pIssuingScale) {
		this.pIssuingScale = pIssuingScale;
	}
	public String getpName() {
		return pName;
	}
	public void setpName(String pName) {
		this.pName = pName;
	}
	public String getpCode() {
		return pCode;
	}
	public void setpCode(String pCode) {
		this.pCode = pCode;
	}
	public String getFaid() {
		return faid;
	}
	public void setFaid(String faid) {
		this.faid = faid;
	}
	public Integer getPid() {
		return pid;
	}
	public void setPid(Integer pid) {
		this.pid = pid;
	}
	public Integer getClientid() {
		return clientid;
	}
	public void setClientid(Integer clientid) {
		this.clientid = clientid;
	}
	public BigDecimal getAmount() {
		return amount;
	}
	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}
	
	
	public Integer getPayStatus() {
		return payStatus;
	}
	public void setPayStatus(Integer payStatus) {
		this.payStatus = payStatus;
	}
	public BigDecimal getRebateRate() {
		return rebateRate;
	}
	public void setRebateRate(BigDecimal rebateRate) {
		this.rebateRate = rebateRate;
	}
	public BigDecimal getRebateAmount() {
		return rebateAmount;
	}
	public void setRebateAmount(BigDecimal rebateAmount) {
		this.rebateAmount = rebateAmount;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	public String getCreateBy() {
		return createBy;
	}
	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}
	public Date getUpdateDate() {
		return updateDate;
	}
	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}
	public String getUpdateBy() {
		return updateBy;
	}
	public void setUpdateBy(String updateBy) {
		this.updateBy = updateBy;
	}
	public Integer getFaCorpId() {
		return faCorpId;
	}
	public void setFaCorpId(Integer faCorpId) {
		this.faCorpId = faCorpId;
	}
	public String getFaCorpName() {
		return faCorpName;
	}
	public void setFaCorpName(String faCorpName) {
		this.faCorpName = faCorpName;
	}
	public String getFaRealName() {
		return faRealName;
	}
	public void setFaRealName(String faRealName) {
		this.faRealName = faRealName;
	}
	public String getuImage() {
		return uImage;
	}
	public void setuImage(String uImage) {
		this.uImage = uImage;
	}
	public BigDecimal getSellingPrice() {
		return sellingPrice;
	}
	public void setSellingPrice(BigDecimal sellingPrice) {
		this.sellingPrice = sellingPrice;
	}
	public BigDecimal getSellingRebate() {
		return sellingRebate;
	}
	public void setSellingRebate(BigDecimal sellingRebate) {
		this.sellingRebate = sellingRebate;
	}
	public BigDecimal getCostPrice() {
		return costPrice;
	}
	public void setCostPrice(BigDecimal costPrice) {
		this.costPrice = costPrice;
	}
	public BigDecimal getCostRebate() {
		return costRebate;
	}
	public void setCostRebate(BigDecimal costRebate) {
		this.costRebate = costRebate;
	}
	public BigDecimal getCorePrice() {
		return corePrice;
	}
	public void setCorePrice(BigDecimal corePrice) {
		this.corePrice = corePrice;
	}
	public BigDecimal getCoreRebate() {
		return coreRebate;
	}
	public void setCoreRebate(BigDecimal coreRebate) {
		this.coreRebate = coreRebate;
	}
	public BigDecimal getTransactionPrice() {
		return transactionPrice;
	}
	public void setTransactionPrice(BigDecimal transactionPrice) {
		this.transactionPrice = transactionPrice;
	}
	public BigDecimal getTransactionRebate() {
		return transactionRebate;
	}
	public void setTransactionRebate(BigDecimal transactionRebate) {
		this.transactionRebate = transactionRebate;
	}
	public String getAnnualRevenue() {
		return annualRevenue;
	}
	public void setAnnualRevenue(String annualRevenue) {
		this.annualRevenue = annualRevenue;
	}
	public Boolean getFlagUpload() {
		return flagUpload;
	}
	public void setFlagUpload(Boolean flagUpload) {
		this.flagUpload = flagUpload;
	}
	public String getpType() {
		return pType;
	}
	public void setpType(String pType) {
		this.pType = pType;
	}
	public String getUuId() {
		try {
			return SecureUtil.encrypt( getFaid()+Constants.UUID_DELIMITER+getFaName());
		} catch (Exception e) {
			return "";
		}
	
	}
	public void setUuId(String uuId) {
		this.uuId = uuId;
	}
	public String getFaEmail() {
		return faEmail;
	}
	public void setFaEmail(String faEmail) {
		this.faEmail = faEmail;
	}
	public BigDecimal getBackRebateRate() {
		return backRebateRate;
	}
	public void setBackRebateRate(BigDecimal backRebateRate) {
		this.backRebateRate = backRebateRate;
	}
	public BigDecimal getBackRebateAmount() {
		return backRebateAmount;
	}
	public void setBackRebateAmount(BigDecimal backRebateAmount) {
		this.backRebateAmount = backRebateAmount;
	}
	public BigDecimal getBackSellingPrice() {
		return backSellingPrice;
	}
	public void setBackSellingPrice(BigDecimal backSellingPrice) {
		this.backSellingPrice = backSellingPrice;
	}
	public BigDecimal getBackSellingRebate() {
		return backSellingRebate;
	}
	public void setBackSellingRebate(BigDecimal backSellingRebate) {
		this.backSellingRebate = backSellingRebate;
	}
	public BigDecimal getBackCostPrice() {
		return backCostPrice;
	}
	public void setBackCostPrice(BigDecimal backCostPrice) {
		this.backCostPrice = backCostPrice;
	}
	public BigDecimal getBackCostRebate() {
		return backCostRebate;
	}
	public void setBackCostRebate(BigDecimal backCostRebate) {
		this.backCostRebate = backCostRebate;
	}
	public BigDecimal getBackCorePrice() {
		return backCorePrice;
	}
	public void setBackCorePrice(BigDecimal backCorePrice) {
		this.backCorePrice = backCorePrice;
	}
	public BigDecimal getBackCoreRebate() {
		return backCoreRebate;
	}
	public void setBackCoreRebate(BigDecimal backCoreRebate) {
		this.backCoreRebate = backCoreRebate;
	}
	public BigDecimal getBackTransactionPrice() {
		return backTransactionPrice;
	}
	public void setBackTransactionPrice(BigDecimal backTransactionPrice) {
		this.backTransactionPrice = backTransactionPrice;
	}
	public BigDecimal getBackTransactionRebate() {
		return backTransactionRebate;
	}
	public void setBackTransactionRebate(BigDecimal backTransactionRebate) {
		this.backTransactionRebate = backTransactionRebate;
	}
	public String getoMediaSource() {
		return oMediaSource;
	}
	public void setoMediaSource(String oMediaSource) {
		this.oMediaSource = oMediaSource;
	}
	public String getoOwnerId() {
		return oOwnerId;
	}
	public void setoOwnerId(String oOwnerId) {
		this.oOwnerId = oOwnerId;
	}
	public BigDecimal getoYouDanRebate() {
		return oYouDanRebate;
	}
	public BigDecimal getoYouDanPrice() {
		return oYouDanPrice;
	}
	public void setoYouDanRebate(BigDecimal oYouDanRebate) {
		this.oYouDanRebate = oYouDanRebate;
	}
	public void setoYouDanPrice(BigDecimal oYouDanPrice) {
		this.oYouDanPrice = oYouDanPrice;
	}
	public Integer getoBackStatus() {
		return oBackStatus;
	}
	public void setoBackStatus(Integer oBackStatus) {
		this.oBackStatus = oBackStatus;
	}
	public BigDecimal getoRebateAmount() {
		BigDecimal allRebateAmount = new BigDecimal(0);
		// 有单出单
		if(null != this.oOwnerId){
			if(this.payStatus.intValue() >= 330){
				allRebateAmount.add(null == this.oYouDanRebate?new BigDecimal(0) : this.oYouDanRebate);
			}
			if(null != this.oBackStatus && this.oBackStatus.intValue() ==331){
				// 后端佣金
				allRebateAmount.add(null == this.backTransactionRebate?new BigDecimal(0) : this.backTransactionRebate);
			}
		}else{// 非有单佣金
			if(this.payStatus.intValue() >= 330){
				allRebateAmount.add(null == this.transactionRebate?new BigDecimal(0) : this.transactionRebate);
			}
			if(null != this.oBackStatus && this.oBackStatus.intValue() ==331){
				// 后端佣金
				allRebateAmount.add(null == this.backTransactionRebate?new BigDecimal(0) : this.backTransactionRebate);
			}
		}
		return allRebateAmount;
	}
	public Integer getAnnualRrevenueId() {
		return annualRrevenueId;
	}
	public void setAnnualRrevenueId(Integer annualRrevenueId) {
		this.annualRrevenueId = annualRrevenueId;
	}
	public Integer getBiddingReceiptId() {
		return biddingReceiptId;
	}
	public void setBiddingReceiptId(Integer biddingReceiptId) {
		this.biddingReceiptId = biddingReceiptId;
	}
	public BigDecimal getoYouDanReceivedRebate() {
		return oYouDanReceivedRebate;
	}
	public void setoYouDanReceivedRebate(BigDecimal oYouDanReceivedRebate) {
		this.oYouDanReceivedRebate = oYouDanReceivedRebate;
	}

	public String getCreateDateStr() {
		return createDateStr;
	}

	public void setCreateDateStr(String createDateStr) {
		this.createDateStr = createDateStr;
	}

	public BigDecimal getCommission() {
		return commission;
	}

	public void setCommission(BigDecimal commission) {
		this.commission = commission;
	}
	public String getShopperId() {
		return shopperId;
	}
	public void setShopperId(String shopperId) {
		this.shopperId = shopperId;
	}
	public String getoStatus() {
		return oStatus;
	}
	public void setoStatus(String oStatus) {
		this.oStatus = oStatus;
	}
	public String getNoStatus() {
		return noStatus;
	}
	public void setNoStatus(String noStatus) {
		this.noStatus = noStatus;
	}
	public String getcMobile() {
		return cMobile;
	}
	public void setcMobile(String cMobile) {
		this.cMobile = cMobile;
	}
//	public String getTimeStr() {
//		return timeStr;
//	}
//	public void setTimeStr(String timeStr) {
//		this.timeStr = timeStr;
//	}
	public String getIsAll() {
		return isAll;
	}
	public void setIsAll(String isAll) {
		this.isAll = isAll;
	}
	public String getAllOrderStatus() {
		return allOrderStatus;
	}
	public void setAllOrderStatus(String allOrderStatus) {
		this.allOrderStatus = allOrderStatus;
	}
}
